no inlinks found?

Hey guys,

i've found a strange thing concerning incoming links.
My script loads a module, loops for objects and loops for incoming links in every object.
The strange this is when i start doors and run the script no links are found.
When i then open the module (manually) and close it, without changing something or saving, and run the script again, all links are found.

Can someone help me?

Here's a short extract of my script:
 

ModName_ tar1  = module(targetModule1)
ModuleVersion modver = moduleVersion(tar1)
Module m             = load(modver, false)
 
Object o
    
Link lnk
 
for o in entire m do
{
        
        for lnk in o <- "*" do
        {
                print "Inlink found!\n"       
        }
        
}

 


Regards,
Manuel

 


ManuelFelger - Mon Aug 24 11:00:36 EDT 2009

Re: no inlinks found?
IBM_Gust - Mon Aug 24 13:46:09 EDT 2009

The behavior you describe is what should be expected. In the help file you will file you will find a loop to open the modules so links can be read. Look under linkreference

Re: no inlinks found?
llandale - Mon Aug 24 19:10:09 EDT 2009

Yes, the manual does say that you don't see incoming 'links' unless the source module is open. Yes, you can find source modules and open them using LinkRef s. So incoming link scripts have two loops, <1> for all objects/all in LinkRefs, find the source module and open it <2> the "Link" loop you have.

Its odd to me it works the 2nd time, since the source shouldn't open (invisibly) when you open the target. Perhaps that module's default view has some Layout that opens the source module. Check out the Explorer's Tools menu >Manage Open Modules.

  • Louie

Re: no inlinks found?
ManuelFelger - Tue Aug 25 05:55:31 EDT 2009

llandale - Mon Aug 24 19:10:09 EDT 2009
Yes, the manual does say that you don't see incoming 'links' unless the source module is open. Yes, you can find source modules and open them using LinkRef s. So incoming link scripts have two loops, <1> for all objects/all in LinkRefs, find the source module and open it <2> the "Link" loop you have.

Its odd to me it works the 2nd time, since the source shouldn't open (invisibly) when you open the target. Perhaps that module's default view has some Layout that opens the source module. Check out the Explorer's Tools menu >Manage Open Modules.

  • Louie

Yes, the Explorer's Tools menu >Manage Open Modules tells me when i open the module manually that a few link modules are open for read but not displayed.

So i need to open all source modules? I dont understand what you meant with the first loop "<1> for all objects/all in LinkRefs, find the source module and open it" could you give me an example, please?

Manuel

Re: no inlinks found?
SystemAdmin - Tue Aug 25 06:25:17 EDT 2009

ManuelFelger - Tue Aug 25 05:55:31 EDT 2009
Yes, the Explorer's Tools menu >Manage Open Modules tells me when i open the module manually that a few link modules are open for read but not displayed.

So i need to open all source modules? I dont understand what you meant with the first loop "<1> for all objects/all in LinkRefs, find the source module and open it" could you give me an example, please?

Manuel

One example:
 

Link lnk
Object o 
int numLinks = 0
for o in current Module do {
     LinkRef lref
     for lref in o <- "*" do {
         string srcModName = fullName source (lref)
         if (! open module srcModName) {
             read (srcModName, false)
         }
     }
     for lnk in o <- "*" do {
            numLinks++
     }
}
print "There are " numLinks " incoming links in this module"

Re: no inlinks found?
ManuelFelger - Tue Aug 25 08:36:15 EDT 2009

SystemAdmin - Tue Aug 25 06:25:17 EDT 2009

One example:
 

Link lnk
Object o 
int numLinks = 0
for o in current Module do {
     LinkRef lref
     for lref in o <- "*" do {
         string srcModName = fullName source (lref)
         if (! open module srcModName) {
             read (srcModName, false)
         }
     }
     for lnk in o <- "*" do {
            numLinks++
     }
}
print "There are " numLinks " incoming links in this module"

Thanks, thats very helpful!
It works!